<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <body>

        <ui:composition template="./dl.xhtml">

            <ui:define name="mcontent">
                <h:form >
                    <p:panelGrid columns="1" >
                        <p:commandButton ajax="false" value="Back" action="dl" ></p:commandButton>
                        <p:dataTable value="#{patientReportController.recentReportsOrderedByDoctor}" var="r" rowIndexVar="n" rowKey="#{r.id}" >
                            <p:column headerText="Name" sortBy="#{r.patientInvestigation.billItem.bill.patient.person.name}" >
                                <p:outputLabel value="#{r.patientInvestigation.billItem.bill.patient.person.name}" ></p:outputLabel>
                            </p:column>
                            <p:column headerText="Test" sortBy="#{r.patientInvestigation.investigation.name}">
                                <p:commandLink value="#{r.patientInvestigation.investigation.name}" ajax="false" action="report_values" >
                                    <f:setPropertyActionListener value="#{r}" target="#{patientReportController.currentPatientReport}" ></f:setPropertyActionListener>
                                </p:commandLink>
                            </p:column>
                        </p:dataTable>
                    </p:panelGrid>
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
